<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      <title>cx:wait-for-update</title>
      <meta charset="utf-8" />
      <meta name="generator" content="DocBook XSL 2.0 Stylesheets V2.5.0" />
      <link href="css/default.css" rel="stylesheet" type="text/css" />
      <link href="css/db-prism.css" rel="stylesheet" type="text/css" />
      <link rel="stylesheet" href="css/xproc.css" type="text/css" /><script type="text/javascript" src="js/dbmodnizr.js"></script></head>
   <body>
      <div class="page">
         <div class="content">
            <div xmlns:tmpl="http://docbook.org/xslt/titlepage-templates" class="navheader">
               <table border="0" cellpadding="0" cellspacing="0" width="100%" summary="Navigation table">
                  <tr>
                     <td align="left"> <a title="XML Calabash Reference" href="index.html"><img src="img/home.png" alt="Home" border="0" /></a> <a href="cx-uri-info.html" title="cx:uri-info"><img src="img/prev.png" alt="Prev" border="0" /></a> <a title="XML Calabash Extension Steps" href="cx-steps.html"><img src="img/up.png" alt="Up" border="0" /></a> <a title="cxu:compare" href="cxu-compare.html"><img src="img/next.png" alt="Next" border="0" /></a></td>
                     <td align="right"><i>XML Calabash Reference</i> (Version 0.28)</td>
                  </tr>
               </table>
            </div>
            <div class="body">
               <article id="cx-wait-for-update" class="refentry">
                  <div class="content">
                     <div class="refnamediv">
                        <h2>Name</h2>
                        <p><span class="refname">cx:wait-for-update</span><span class="refpurpose"><span class="refpurpose-sep"> — </span><span class="refpurpose-text">Pause execution until a URI has changed</span><span class="refpurpose-punc">.</span></span></p>
                     </div>
                     <div xmlns:tmpl="http://docbook.org/xslt/titlepage-templates" class="refsynopsisdiv">
                        <h2>Synopsis</h2>
                        <p class="element-syntax element-syntax-declare-step-opt"><span class="decl"><code>&lt;p:declare-step</code> <code class="attr type-attr">type</code><code>="</code><code class="value type-value">cx:wait-for-update</code><code>"</code> <code class="attr xmlns-attr">xmlns:cx</code><code>="</code><code class="value xmlns-value">http://xmlcalabash.com/ns/extensions</code><code>"</code><code>&gt;</code></span><br />     <span class="input"><code>&lt;p:output</code> <code class="attr port-attr">port</code><code>="</code><code class="value port-value">result</code><code>"</code><code>/&gt;</code></span><br />     <span class="opt-req"><code>&lt;p:option</code> <code class="attr name-attr">name</code><code>="</code><code class="value name-value">href</code><code>"</code> <code class="attr required-attr">required</code><code>="</code><code class="value required-value">true</code><code>"</code><code>/&gt;</code><code>                       </code><code class="comment">&lt;!-- </code><span class="opt-type">xd:anyURI</span><code class="comment"> --&gt;</code></span><br />     <span class="opt-opt"><code>&lt;p:option</code> <code class="attr name-attr">name</code><code>="</code><code class="value name-value">pause-before</code><code>"</code><code>/&gt;</code><code>                               </code><code class="comment">&lt;!-- </code><span class="opt-type">int</span><code class="comment"> --&gt;</code></span><br />     <span class="opt-opt"><code>&lt;p:option</code> <code class="attr name-attr">name</code><code>="</code><code class="value name-value">pause-after</code><code>"</code><code>/&gt;</code><code>                                </code><code class="comment">&lt;!-- </code><span class="opt-type">int</span><code class="comment"> --&gt;</code></span><br /><code>&lt;/p:declare-step&gt;</code></p>
                     </div>
                     <div class="refsection">
                        <div class="refsection-titlepage">
                           <h2>Description</h2>
                        </div>
                        <div class="content">
                           
                           
                           
                           <p>This step pauses execution of the pipeline until the URI specified in
                              the <code class="option">href</code> option has changed. At present, only <code class="literal">file:</code>
                              and <code class="literal">http:</code> (<code class="literal">https:</code>) URIs are supported.</p>
                           
                           
                           <p>Additionally, the following options are supported:</p>
                           
                           
                           <div class="variablelist">
                              <dl>
                                 <dt><span class="term"><code class="option">pause-before</code></span></dt>
                                 <dd>
                                    <p>If specified, the step will unconditionally pause for
                                       <code class="option">pause-before</code> seconds before beginning to test for updates.
                                       </p>
                                 </dd>
                                 <dt><span class="term"><code class="option">pause-after</code></span></dt>
                                 <dd>
                                    <p>If specified, the step will unconditionally pause for
                                       <code class="option">pause-after</code> seconds after detecting an update.
                                       </p>
                                 </dd>
                              </dl>
                           </div>
                           
                           
                           <p>For the purpose of determining if a file has changed, one of the following
                              conditions must be satisfied:</p>
                           
                           
                           <div class="orderedlist">
                              <ol style="list-style: decimal;">
                                 <li>
                                    <p>If the file does not exist when the step begins running, then it is
                                       deemed to have changed as soon as it is seen to exist.</p>
                                 </li>
                                 <li>
                                    <p>If the file exists when the step begins running, then it is deemed to
                                       have changed as soon as the last modified time changes.</p>
                                 </li>
                              </ol>
                           </div>
                           
                           
                           <p>For the purpose of determining if an HTTP URI has changed, one of the following
                              conditions must be satisfied:</p>
                           
                           
                           <div class="orderedlist">
                              <ol style="list-style: decimal;">
                                 <li>
                                    <p>If a HEAD request returns 404 when the step begins running, then it is
                                       deemed to have changed as soon as it returns something else.</p>
                                 </li>
                                 <li>
                                    <p>If HEAD returns 200 when the step begins running, then it is deemed to
                                       have changed as soon as the last modified time changes. The last modified time
                                       is taken from the <code class="literal">last-modified</code> header, if it exists, or the
                                       <code class="literal">date</code> header if it exists.</p>
                                 </li>
                              </ol>
                           </div>
                           
                           
                           <p>It follows that if neither header exists, or if the server returns anything
                              other than 200 or 404, the URI is deemed to exist.</p>
                           
                           </div>
                     </div>
                  </div>
               </article>
            </div>
         </div>
         <div xmlns:tmpl="http://docbook.org/xslt/titlepage-templates" class="navfooter">
            <table width="100%" summary="Navigation table">
               <tr>
                  <td width="40%" align="left"><a title="cx:uri-info" href="cx-uri-info.html"><img src="img/prev.png" alt="Prev" border="0" /></a> </td>
                  <td width="20%" align="center"><a title="XML Calabash Reference" href="index.html"><img src="img/home.png" alt="Home" border="0" /></a></td>
                  <td width="40%" align="right"> <a title="cxu:compare" href="cxu-compare.html"><img src="img/next.png" alt="Next" border="0" /></a></td>
               </tr>
               <tr>
                  <td width="40%" align="left">cx:uri-info </td>
                  <td width="20%" align="center"><a title="XML Calabash Extension Steps" href="cx-steps.html"><img src="img/up.png" alt="Up" border="0" /></a></td>
                  <td width="40%" align="right"> cxu:compare</td>
               </tr>
            </table>
         </div>
         <div xmlns:tmpl="http://docbook.org/xslt/titlepage-templates" class="copyrightfooter">
            <p><a href="dbcpyright.html">Copyright</a> © 2011–2020 Norman Walsh.</p>
         </div>
      </div>
   </body>
</html>